﻿@model IEnumerable<Blog.Models.PostModel>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Blogginlägg</h1>
    <p>
    </p>
    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreationDate)
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink(item.Title, "EditPost", new { id = item.PostId })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreationDate)
                </td>
                <td>
                    @Html.ActionLink("Redigera", "EditPost", new { id = item.PostId }) |
                    @Html.ActionLink("Radera", "DeletePost", new { id = item.PostId })
                </td>
            </tr>
        }

    </table>
</div>
